package com.exam.api.config;

import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import lombok.extern.slf4j.Slf4j;
import org.springdoc.core.customizers.GlobalOpenApiCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author bcheng
 * @Create 2024/1/14 11:04
 * @Description OpenAPI配置类
 */
@Slf4j
@Configuration
public class OpenAPIConfig {

    @Bean
    public GlobalOpenApiCustomizer definitionGlobalOpenApiCustomizer() {
        return openApi -> {
            Info info = new Info();
            info.setTitle("河北净菜API文档");
            info.setDescription("河北净菜API文档 v0.0.1");
            Contact contact = new Contact();
            contact.setName("代码澎湃");
            contact.setEmail("1@qq.com");
            info.setContact(contact);
            info.setVersion("v0.0.1");
            openApi.setInfo(info);
        };
    }
}
